/**
 * @param {number[]} nums1
 * @param {number[]} nums2
 * @return {number[]}
*/
var anagramMappings = function(nums1, nums2) {
  let result = [];
  for(let i = 0; i < nums1.length; i++) {
    result.push(nums2.indexOf(nums1[i]));
  }
  return result;
};
let nums1 = [12, 28, 46, 32, 50], nums2 = [50, 12, 32, 46, 28];
console.log(anagramMappings(nums1, nums2));
